load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "mixedversion",
    srcs = [
        "context.go",
        "helper.go",
        "mixedversion.go",
        "mutators.go",
        "planner.go",
        "runner.go",
        "steps.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/mixedversion",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/cmd/roachprod/grafana",
        "//pkg/cmd/roachtest/cluster",
        "//pkg/cmd/roachtest/option",
        "//pkg/cmd/roachtest/registry",
        "//pkg/cmd/roachtest/roachtestutil",
        "//pkg/cmd/roachtest/roachtestutil/clusterupgrade",
        "//pkg/cmd/roachtest/test",
        "//pkg/roachpb",
        "//pkg/roachprod/install",
        "//pkg/roachprod/logger",
        "//pkg/roachprod/vm",
        "//pkg/testutils/release",
        "//pkg/util/ctxgroup",
        "//pkg/util/intsets",
        "//pkg/util/randutil",
        "//pkg/util/retry",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@org_golang_x_exp//maps",
    ],
)

go_test(
    name = "mixedversion_test",
    srcs = [
        "context_test.go",
        "helper_test.go",
        "main_test.go",
        "mixedversion_test.go",
        "mutators_test.go",
        "planner_test.go",
        "runner_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":mixedversion"],
    embedsrcs = ["testdata/test_releases.yaml"],
    deps = [
        "//pkg/cmd/roachtest/option",
        "//pkg/cmd/roachtest/registry",
        "//pkg/cmd/roachtest/roachtestutil",
        "//pkg/cmd/roachtest/roachtestutil/clusterupgrade",
        "//pkg/roachpb",
        "//pkg/roachprod/install",
        "//pkg/roachprod/logger",
        "//pkg/roachprod/vm",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/release",
        "//pkg/util/intsets",
        "//pkg/util/randutil",
        "//pkg/util/version",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v2//:yaml_v2",
    ],
)
